// src/api/instore/storagePosition.js
import request from '@/utils/request'

// 查询储位列表
export function listStoragePosition(query) {
  return request({
    url: '/api/storagePosition/page',
    method: 'get',
    params: query
  })
}

// 查询储位详情
export function getStoragePosition(storageId) {
  return request({
    url: `/api/storagePosition/${storageId}`,
    method: 'get'
  })
}

// 新增储位
export function addStoragePosition(data) {
  return request({
    url: '/api/storagePosition/add',
    method: 'post',
    data: data
  })
}

// 修改储位
export function updateStoragePosition(data) {
  return request({
    url: '/api/storagePosition/update',
    method: 'post',
    data: data
  })
}

// 删除储位
export function delStoragePosition(storageId) {
  return request({
    url: '/api/storagePosition/delete/' + storageId,
    method: 'post'
  })
}

// 批量设置储位库区
export function batchSetWarehouseZones(data) {
  return request({
    url: '/api/storagePosition/batchSetWarehouseZones',
    method: 'post',
    params: data
  })
}

export function updateStatusAPI(data) {
  return request({
    url: '/api/storagePosition/updateDisableStatus',
    method: 'get',
    params: data
  })
}

export function getAvailableListAPI(data) {
  return request({
    url: '/api/warehouseZones/available',
    method: 'get',
    params: data
  })
}